<?php
// 本类由系统自动生成，仅供测试用途
class WebconfigAction extends BaseAction {
    public function __construct() {
        parent::__construct();
        //语言包设置
        $language['ch']=array(
            //头部
            "titlebt"=>'设计模式',
            "now_path"=>'当前位置',
            "header_admin"=>"设计模式",
            "header_add"=>"添加模块",
            "header_value1"=>"在这里，你可以设置",
            "header_value2"=>"模块",
            "header_value3"=>"其他3",
            "header_value4"=>"其他4",
            "header_value5"=>"其他5",
            "header_value6"=>"其他6",
            "titlebt2"=>"设计模式",
        );
        
        //解析语言包
        $this->assign("language",$language['ch']);
        
        
    }
    public function index(){
        $config=D("webconfig");
        $vo=$config
            ->find();
        $this->assign("vo",$vo);
        //echo C("TMPL_ACTION_SUCCESS");
       //echo THINK_PATH."Public/dispatch_jump.html";
        $this->display();
    }
    public function update(){
        $config=D("webconfig");
       if(isset($_POST)){
           $update_arr=Array(
                "webconfig_webname"=>$_POST['webconfig_webname'],
                "webconfig_url"=>$_POST['webconfig_url'],
                "webconfig_record"=>$_POST['webconfig_record'],
                "webconfig_keyword"=>$_POST['webconfig_keyword'],
                "webconfig_theme"=>$_POST['webconfig_theme'],
                "webconfig_license"=>$_POST['webconfig_license'],
                "webconfig_phone"=>$_POST['webconfig_phone'],
                "webconfig_address"=>$_POST['webconfig_address'],
                "webconfig_email"=>$_POST['webconfig_email'],
                "webconfig_qq1"=>$_POST['webconfig_qq1'],
                "webconfig_fax"=>$_POST['webconfig_fax'],
           );
           $update=$config->where("1")->data($update_arr)->save();
          
           if($update!==FALSE){
               $this->success("修改成功");
           }else{
               $this->error("修改失败");
           }
       }else{
           $this->error("数据错误");
       }
        
    }
    
   
    
}